function gewScene3D(game,                    
                    shadow_map_width,shadow_map_height,
                    world_size,cell_size,
                    isUseFilter,tex_width,tex_height,
                    isUseDepthMask)
{
  this.game = game;
  this.gl = game.gl;  
  ////////////////////////////////////////////////////////////////////////
  // Create shadow map
  if(!shadow_map_width)
    shadow_map_width = 1024;
  if(!shadow_map_height)
    shadow_map_height = 1024;
  this.shadowMapWidth = 0;
  this.shadowMapHeight = 0;
  this.shadowMap = null;
  this.createShadowMap(shadow_map_width,shadow_map_height);
  ///////////////////////////////////////////////////////////////////////////
  // Create quad tree
  if(!world_size)
    var world_size = 1024;
  if(!cell_size)
    var cell_size = 64;
  this.worldSize = world_size;
  this.cellSize = cell_size;
  this.quadTree = new gewQuadTree(world_size/2,cell_size/2);
  //////////////////////////////////////////////////////////////////////////
  // Create filter
  if(isUseFilter==true)
  {
    this.isUseFilter = true;
    // Create offscreen framebuffer
    if(!tex_width)
      tex_width = gewSmallestPowerOfTwo(game.width);
    if(!tex_height)
      tex_height = gewSmallestPowerOfTwo(game.height);
    this.textureWidth = tex_width;
    this.textureHeight = tex_height;
    this.srcColorGLTexture = null;
    this.srcDepthGLTexture = null;
    this.createFilterTexture(tex_width,tex_height);    
    this.filters = new gewFilter(this.game, this.srcColorGLTexture,this.srcDepthGLTexture,
                                            game.width,game.height,
                                            this.textureWidth,this.textureHeight);
  }
  this.root = new gewNode("root");
  this.root.modelMat = null;
  this.root.game = game;
  this.root.gl = game.gl;
  this.root.scene3d = this;
  this.camera_system = new gewCameraSystem();
  this.effects = [];
  this.frustumCullingFrame = 5; // The number of frame that redo view frustum culling 
  this.wind = new gewVec3(0,0,5);
  ///////////////////////////////////////////////////////////////////////////////
  // Create DepthMask Effect
  if(isUseDepthMask==true)
  {
    this.isUseDepthMask = true;
    var depthMaskE = new gewDepthMaskEffect(game);
    var depthMaskM = new gewDepthMaskMaterial(depthMaskE,"DepthMaskMesh");
    var depthMaskTerrainM = new gewDepthMaskMaterial(depthMaskE,"DepthMaskTerrain");
    depthMaskM.type = GEW_DEPTH_MASK_MESH;
    depthMaskM.batchType = GEW_VERTEX_CONSTANTS_BATCH;
    depthMaskTerrainM.type = GEW_DEPTH_MASK_TERRAIN;
    this.addEffect(depthMaskE);
    this.depthMaskEffect = depthMaskE;
    this.depthMaskMeshMaterial = depthMaskM;
    this.depthMaskTerrainMaterial = depthMaskTerrainM;
  }
  else
    this.isUseDepthMask = false;
  // View& Proj mat
  this.viewMat = null;
  this.projectMat = null;
  // Main directional light
  this.mainLight = new gewDirectionalLight();// the main light of a scene must be a directional light
  this.mainLight.setData(new gewVec3(-1,-1.4,1),new gewVec3(1.,1.,1.),new gewVec3(1.,1.,1.), 0.7);
  // Fog
  this.fog = {};
  /* Fog mode : 0 - No Fog
                1 - Homogeneous Fog
                2 - Layered Fog
  */
  this.fog.mode = 0;
  this.fog.density = 0.003;
  this.fog.color = new gewVec3(1.,1.,1.);
  this.fog.minFactor = 0.0;
  this.fog.maxFactor = 1.0;
  this.fog.layeredHeightOffset = 0.0;
  this.fog.layeredFactor = 1.0;
  if( DEBUG_DRAW)
  {
    var gl = this.gl;
    this.debugDrawer = {};
    this.debugDrawer.vs = createVertexShader(gl, debugVertexShaderStr);
    this.debugDrawer.fs = createFragmentShader(gl,debugFragmentShaderStr);
    var program = gl.createProgram();
    gl.attachShader(program,this.debugDrawer.vs);
    gl.attachShader(program,this.debugDrawer.fs);
    gl.linkProgram(program);
    checkProgramLinkStatus(gl,program);
    this.debugDrawer.program = program;
    this.debugDrawer.inPosition = gl.getAttribLocation(program, "inPosition");
    this.debugDrawer.modelViewProjectionMat = gl.getUniformLocation(program, "modelViewProjectionMat");
    this.debugDrawer.inColor = gl.getUniformLocation(program, "inColor");
  }
  // PRIVATE 
  this.frustumCullingFrameCount = 0;
  this.viewMat = new gewMat4();
  this.projectMat = new gewMat4();
  this.viewProjectMat = new gewMat4();
  this.inverseViewMat = new gewMat4();
  this.inverseProjectMat = new gewMat4();
  this.inverseViewProjectMat = new gewMat4();
  this.frustum = new gewFrustum();
  this.isFrustumUpdated = false; 
  this.physicsEngine = null; // the physics engine that effect this scene3d   
}
// This func is slow!
gewScene3D.prototype.getNodeByName = function(name)
{  
  return this.root.getChildByName(name);
}
gewScene3D.prototype.getEffect=function(name)
{
  var effects = this.effects;
  var eNum = effects.length;
  for(var i=0;i<eNum;i++)
  {
    if(effects[i].name==name)
      return effects[i];
  }
  return null;
}
gewScene3D.prototype.addEffect = function(e,idx)
{
  var isExist = this.getEffect(e.name)
  if(isExist)
    return;
  if(!idx)
    this.effects.push(e);
  else
    this.effects.splice(idx,0,e);
}
gewScene3D.prototype.removeEffect = function(e)
{
  var effects = this.effects;
  var eNum = effects.length;
  for(var i=0;i<eNum;i++)
  {
    if (effects[i] == e) {
      effects.splice(i, 1);
      return;
    }  
  }
}
gewScene3D.prototype.render = function(mls)
{
  var root = this.root;
  var gl = this.gl;
  var nodeList = root.children;
  var nodeListLen = nodeList.length;
  this.frustumCullingFrameCount++;
  var unclearMask = NODE_FRUSTUM_IN;
  // animate node& update the transform matrix
  for(var i=0;i<nodeListLen;i++)
  {
    nodeList[i].prepareRender();
  }
  // Update matrixs : 
  //    + viewMat
  //    + projectMat
  //    + viewProjectMat
  //    + inverseViewMat
  //    + inverseProjectMat
  //    + inverseViewProjectMat
  var active_cam = this.camera_system.getActiveCamera();
  this.viewMat = active_cam.getViewMatrix();
  this.viewPosition = active_cam.getDesiredPos(); //new gewVec3(0,0,10);
  this.projectMat = active_cam.getProjMatrix();//makePerspective(60, 1, 0.1, 100);
  this.projectMat.mul(this.viewMat,this.viewProjectMat);
  this.inverseViewMat.copyFrom(this.viewMat);
  this.inverseViewMat.inverse();
  this.inverseProjectMat.copyFrom(this.projectMat);
  this.inverseProjectMat.inverse();
  this.inverseViewMat.mul(this.inverseProjectMat,this.inverseViewProjectMat);
  // View frustum culling ( Lazy)
  if(this.frustumCullingFrame==this.frustumCullingFrameCount)
    unclearMask = 0;  
  if(this.frustumCullingFrameCount> this.frustumCullingFrame)
  {
    this.frustumCullingFrameCount = 0;
    var view_proj_visual = active_cam.m_visual_project_matrix.mul(this.viewMat);
    getFrustumFromMat(view_proj_visual,this.frustum,active_cam,this.inverseViewMat);
    this.isFrustumUpdated = true;
    var frustum = this.frustum;
    this.quadTree.viewFrustumCulling(frustum);
  }
  else
  {
    this.isFrustumUpdated = false;
  }
  //console.log(root.getInFrustumCount());  
  // Render all effect  
  var elist = this.effects;
  var elistLen = this.effects.length;
  for(var i=0;i<elistLen;i++)
  { 
    elist[i].render(this);
  }  
  // Render debug content
  if(DEBUG_DRAW)
  {
    var drawer = this.debugDrawer;
    gl.useProgram(drawer.program);
    gl.enable(gl.DEPTH_TEST);
    gl.enableVertexAttribArray(drawer.inPosition);
    gl.uniformMatrix4fv(drawer.modelViewProjectionMat, false, this.viewProjectMat.data);

    // Draw quadtree cell's aabb
    /*
    gl.uniform4f(drawer.inColor,0.5,0.5,0.5,1.);
    var cell = this.quadTree.cell;
    for(var i =0;i<cell.length;i++)
    {
      drawAabb(gl,drawer,cell[i].aabb);
    }
    */
    //Draw node's aabb
    /*
    gl.uniform4f(drawer.inColor,0.9,0.,0.,1.);
    for(var i=0;i<nodeListLen;i++)
    {
      var node = nodeList[i];
      node.debugDraw();
    }
    */
    /*
    //Draw collision pair 
      
    gl.uniform4f(drawer.inColor,0.0,0.5,0.5,1.);
    var engine = this.physicsEngine;
    var pairs = engine.collisionPairs;
    
    var pair_ver = [];
    var pair_idices = [];
    for(var i in pairs)
    {
      var pair = pairs[i];
      var c1 = pair.body1.sceneNode.worldSphere.center;
      var c2 = pair.body2.sceneNode.worldSphere.center;
      pair_ver.push(c1.x,c1.y,c1.z);
      pair_idices.push( pair_idices.length);
      pair_ver.push(c2.x,c2.y,c2.z);
      pair_idices.push( pair_idices.length);
    }    
    drawPrimitives(gl,drawer,
                    new WebGLFloatArray(pair_ver),
                    pair_idices.length,
                    new WebGLUnsignedShortArray(pair_idices),
                    gl.LINES);
    
    
    /*
    gl.disable(gl.DEPTH_TEST);
    gl.uniform4f(drawer.inColor,0.,1.,0.,1.);
    for (var e = 0; e < elistLen; e++) 
    {
      var effect = elist[e];
      var mList = effect.materialList;
      var mListLen = mList.length;
      for (var m = 0; m < mListLen; m++) 
      {
        var material = mList[m];
        var bList = material.batches;
        var bListLen = bList.length;
        for (var b = 0; b < bListLen; b++) 
        {
          drawBatch(gl, drawer, bList[b]);
        }
      }
    } 
    */
       
    /*
    if(this.terrain) // test terrain
    {
    var n = 256;
    var num = (n/2+1)*(n/2+1);
    gl.uniform4f(drawer.inColor,1.,1.,1.,1.); 
    var indicesLvBlock = this.terrain.block1.level[0].getIndicesArray();
    //drawVerticesAsPoint(gl,drawer,this.terrain.vertices,indicesLvBlock.length,indicesLvBlock);   
    //drawVerticesAsPoint(gl,drawer,this.terrain.vertices, this.terrain.verticesNum);
    //drawPrimitives(gl,drawer,this.terrain.vertices,this.terrain.block0.indicesNum ,this.terrain.block0.indices,gl.LINE_STRIP);
    //drawPrimitives(gl,drawer,this.terrain.vertices,this.terrain.block1.indicesNum,this.terrain.block1.indices,gl.LINE_STRIP,0);
    //drawPrimitives(gl,drawer,this.terrain.vertices,this.terrain.block2.indicesNum,this.terrain.block2.indices,gl.LINE_STRIP);
    //drawPrimitives(gl,drawer,this.terrain.vertices,this.terrain.block3.indicesNum,this.terrain.block3.indices,gl.LINE_STRIP);
    }
    */
    gl.disable(gl.DEPTH_TEST);
    gl.disableVertexAttribArray(drawer.inPosition);
  }  
  
  root.resetFlags(unclearMask);  
}
gewScene3D.prototype.postProcessing = function()
{
  if(this.isUseFilter)
  {
    var gl = this.gl;
    gl.disable(gl.DEPTH_TEST);
    gl.bindTexture(gl.TEXTURE_2D, this.srcColorGLTexture);
    gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0, 0, this.game.width, this.game.height, 0);
    //gl.bindTexture(gl.TEXTURE_2D, this.srcDepthGLTexture);
    //gl.copyTexSubImage2D(gl.TEXTURE_2D, 0, 0,0, 0, 0, this.game.width, this.game.height, 0);
    this.filters.render(this);
  }  
}
gewScene3D.prototype.parseJSON = function(jsonString,physicEngine,isLevelDesign)
{
  var json = JSON.parse(jsonString);
  
  var game = this.game;
  var rManager = game.resourceManager;
  // texture
  var texJson = json.textures;
  var texNum = texJson.length;
  for(var i=0;i<texNum;i++)
  {
    var tex = texJson[i];
    var texParam = new gewTextureParameter(tex.magFilter, tex.minFilter, tex.wrapS, tex.wrapT);
    rManager.load(tex.name,tex.url,true,true,tex.format,texParam,tex.isGenerateMipmap,tex.isFlipY,tex.isPremultiAlpha);
  }
  // floatmap
  var floatMapJson = json.floatMaps;
  var mapNum = floatMapJson.length;
  for(var i=0;i<mapNum;i++)
  {
    var map = floatMapJson[i];
    rManager.load(map.name,map.url,true,true);
  }
  
  // mesh
  var meshJson = json.meshs;
  var meshNum = meshJson.length;
  for(var i=0;i<meshNum;i++)
  {
    var mesh = meshJson[i];
    rManager.load(mesh.name,mesh.url,true,true,mesh.isCreateVBO);
  }
  // scenegraph
  var sceneJson = json.scene;
  
  // Effect  
  var eJson = sceneJson.effects;
  var eNum = eJson.length;
  var allMaterialList = [];
  for(var i=0;i<eNum;i++)
  {
    var e = eJson[i];
    var eName = e.name;
    var effect;
    if(!this.getEffect(eName) ) // effect is not exist
    {
      switch(eName)
      {
        case "CSMEffect":
          effect = new gewCSMEffect(this);
          break;
        case "GrassEffect":
          effect = new gewGrassEffect(game);
          break;
        case "PhongEffect":
          effect = new gewPhongEffect(game);
          break;
        case "PhongNoShadowEffect":
          effect = new gewPhongNoShadowEffect(game);
          break;
        case "SkyboxEffect":
          texture = rManager.getTexture( e.textureName);
          effect = new gewSkyboxEffect(game,texture,e.boxHalfSize);
          break;
        case "TerrainEffect":
          effect = new gewTerrainEffect(game);
          break; 
        case "WaterEffect":
          effect = new gewWaterEffect(game);
          break; 
      }         
      this.addEffect(effect);
    }
    else
      var effect = this.getEffect(eName);
    
    // Material
    var mJson = e.materials;
    var mNum = mJson.length;
    for(var k=0;k<mNum;k++)
    {
      var m = mJson[k];
      var className = m.className;
      var material;
      switch(className)
      {
        case "CSMMaterial":
          material = new gewCSMMaterial(effect,m.name);
          material.type = m.type;
          if(m.type== GEW_SHADOW_ALPHA_REF)
          {
            material.texture = rManager.getTexture( m.textureName);
            material.alphaRef = m.alphaRef;
          }
          break;
        case "GrassMaterial":
          material = new gewGrassMaterial(effect,m.name);
          material.grassPackTexture = rManager.getTexture( m.grassPackTextureName);
          material.alphaRef = m.alphaRef;
          material.strength = m.strength;
          material.swingFactor = m.swingFactor;
          break;
        case "PhongMaterial":
          material = new gewPhongMaterial(effect,m.name);
          material.texture = rManager.getTexture(m.textureName);
          material.ambient.set(m.ambient.x,m.ambient.y,m.ambient.z);
          material.diffuse.set(m.diffuse.x,m.diffuse.y,m.diffuse.z);
          material.specular.set(m.specular.x,m.specular.y,m.specular.z);
          material.shininess = m.shininess;
          material.alphaRef = m.alphaRef;
          material.faceCulling = m.faceCulling;
          break;
        case "TerrainMaterial":
          material = new gewTerrainMaterial(effect,m.name);
          material.heightMap = rManager.getFloatMap(m.heightMapName);
		      this.heightMap = material.heightMap;
          material.textureMap = rManager.getTexture(m.textureMapName);
          material.alphaMap = rManager.getTexture(m.alphaMapName);
          material.materialTex0 = rManager.getTexture(m.materialTex0);
          material.materialTex1 = rManager.getTexture(m.materialTex1);
          material.materialTex2 = rManager.getTexture(m.materialTex2);
          material.materialTex3 = rManager.getTexture(m.materialTex3);
          material.terrainSize = m.terrainSize;
          material.materialSize = m.materialSize;
          material.materialBlendFactor = m.materialBlendFactor;
          material.materialBlendRadius = m.materialBlendRadius;
          material.updateStep = m.updateStep;
          material.ambient = m.ambient;
          material.diffuse = m.diffuse;
          break;
        case "WaterMaterial":
          material = new gewWaterMaterial(effect,name);
          material.normalMap = rManager.getTexture(m.normalMapName);
          material.reflectionMap = rManager.getTexture(m.reflectionMapName);
          material.waterColor = m.waterColor;
          material.waveSize = m.waveSize;  
          material.strength = m.strength;
          break;
      }
      
      if(m.batch)
        material.batchType = m.batch;
      allMaterialList.push(material);
    }
  }
  // Nodes
  var nodesJson = sceneJson.nodes;
  var nodeNum = nodesJson.length;
  var root = this.root;
  for(var i=0;i<nodeNum;i++)
  {
    this.parseNodeJSON(root,nodesJson[i],allMaterialList,json,physicEngine,isLevelDesign);
  }  
}
gewScene3D.prototype.createScenegraphJSONRequest = function(url,physicsEngine,queryItem)
{
  var xhr = new XMLHttpRequest();
  var scene3d = this;
  xhr.onreadystatechange = function()
  {
    if (xhr.readyState == 4) 
    {
      if (xhr.status == 200 || xhr.status == 0) {
        queryItem.status = GEW_DOWNLOAD_STATUS_FINISHED;
        scene3d.parseJSON(xhr.responseText,physicsEngine);
      }
      else {
        alert("createScenegraphJSONRequest::Error when on download file :"+queryItem.url);
      }
    }
  }
  xhr.open("GET",url,true);
  return xhr;
}
gewScene3D.prototype.parseNodeJSON = function(parent,node_json,allMaterialList,json,physicEngine,isLevelDesign)
{
  var type = node_json.type;
  var node;
  var name = node_json.name;
  switch(type)
  {
    case GEW_NODE:
      node = new gewNode(name);      
      break;
    case GEW_MESH_NODE:
      node = new gewMeshNode(name);
      break;
    case GEW_WATER_NODE:
      node = new gewWaterNode(name);
      break;
    case GEW_GRASS_NODE:
      node = new gewGrassNode(this.gl,name,this.heightMap);
      break;
    case GEW_ANIMATED_MESH_NODE:
      node = new gewAnimatedMeshNode(name);
      break;
    case GEW_TERRAIN_NODE:
      node = new gewTerrainNode(this.gl,node_json.clipmapSize,node_json.gridSpace,node_json.levelNum,name);
      break;
  }
  if( node_json.pos != undefined)
    node.setPositionXYZ( node_json.pos[0],node_json.pos[1],node_json.pos[2]);
  if( node_json.sca != undefined)
    node.setScaleXYZ(node_json.sca[0],node_json.sca[1],node_json.sca[2]);
  if( node_json.rot != undefined)
    node.setRotateXYZ(node_json.rot[0],node_json.rot[1],node_json.rot[2],node_json.rot[3]);
    
  var rManager = this.game.resourceManager;
  switch(type)
  {    
    case GEW_MESH_NODE:
      var mesh_name =  json.meshs[node_json.mesh].name;
      var mesh = rManager.getMesh(mesh_name);
      node.setMesh(mesh);
      if(node_json.isPhysics)
      {
        node.shouldCreatePhysicsBody = true;
        if (physicEngine) {
          var body = physicEngine.addRigidBody(node, true, 1, 1);
          body.setShape(mesh);
        }
      }
      break;
    case GEW_WATER_NODE:
      var mesh_name =  json.meshs[node_json.mesh].name;
      node.setMesh( rManager.getMesh(mesh_name));
      break;    
    case GEW_GRASS_NODE:
      node.clumpRatioRange.x = node_json.clumpRatioRange.x;
      node.clumpRatioRange.y = node_json.clumpRatioRange.y;
      node.clumpHeightRange.x = node_json.clumpHeightRange.x;
      node.clumpHeightRange.y = node_json.clumpHeightRange.y;
      node.type0Percent = node_json.type0Percent;
      node.type1Percent = node_json.type1Percent;
      node.type2Percent = node_json.type2Percent;
      node.type3Percent = node_json.type3Percent;
	  
	    node.boxBrushs = node_json.boxBrushs;
	    node.pointBrushs = node_json.pointBrushs;
	    node.isNeedPlantByHeightMap = true;     
      if(isLevelDesign)
        node.keepBrushs = true; 
      break;
  }  
  
  var materialIdx = node_json.ma;
  for(var i =0;i< materialIdx.length;i++)
  {
    node.addMaterial( allMaterialList[ materialIdx[i] ] );
  }  
  
  if(this.isUseDepthMask)
  {
    switch (type) {
      case GEW_MESH_NODE:
        for(var i =0;i< materialIdx.length;i++)
        {
          var m = allMaterialList[ materialIdx[i]];
          var eName = m.effect.name;
          if( (eName=="PhongEffect"||
               eName=="PhongNoShadowEffect")&&
               m.alphaRef == 0.0)
          {   
            node.addMaterial( this.depthMaskMeshMaterial); 
            break;     
          }
        }
        break;
      case GEW_TERRAIN_NODE:
        node.addMaterial( this.depthMaskTerrainMaterial);
        break;
    } 
  }
  
  parent.appendChild(node);
  var children = node_json.child;
  var childNum = children.length;
  for(var i=0;i< childNum;i++)
  {
    this.parseNodeJSON(node,children[i],allMaterialList,json,physicEngine,isLevelDesign);  
  }    
}

gewScene3D.prototype.createShadowMap = function(width,height)
{
  if(this.shadowMap)
    delete this.shadowMap;
  this.shadowMapWidth = width;
  this.shadowMapHeight = height;
  var gl = this.gl;
  this.shadowMap = gl.createTexture();
  var shadowMap = this.shadowMap;
  gl.bindTexture(gl.TEXTURE_2D, shadowMap);
  //try 
  {
    //gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT16, width, height, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_BYTE, null);
    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
  } 
  /*
  catch (e) // for combility with ff 
  {
    var texData = new WebGLUnsignedByteArray(4 * width * height);
    gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT, width, height, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_BYTE, texData);
  }
  */
  gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR)
  gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR)
  gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE)
  gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE)
  //gl.generateMipmap(gl.TEXTURE_2D);
}
 
gewScene3D.prototype.createFilterTexture = function(tex_width,tex_height)
{
  // Create render texture
  var gl = this.gl;
  this.srcColorGLTexture = gl.createTexture();
  var srcColorGLTexture = this.srcColorGLTexture;
  gl.bindTexture(gl.TEXTURE_2D, srcColorGLTexture);
  gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, tex_width, tex_height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
  gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR)
  gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR)
  gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE)
  gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE)
  //gl.generateMipmap(gl.TEXTURE_2D);
  /*
  this.srcDepthGLTexture = gl.createTexture();
  var srcDepthGLTexture = this.srcDepthGLTexture;
  gl.bindTexture(gl.TEXTURE_2D, srcDepthGLTexture);
  gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT16, tex_width, tex_height, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_BYTE, null);
  gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
  gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
  gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
  gl.texParameterf(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);  
  */
}
